<template>
  <div class="content">
    <el-table :data="dataList" border style="width: 100%;">
      <el-table-column align="center" type="index" header-align="center" min-width="150" label="序号">
      </el-table-column>
      <el-table-column align="center" prop="username"  label="操作用户"/>
      <el-table-column align="center" prop="requestUri"  label="链接地址"/>
      <el-table-column align="center" prop="createTime" label="创建时间"/>
      <el-table-column align="center" prop="operation" label="用户操作"/>
      <el-table-column align="center" prop="ip" label="请求地址"/>
      <el-table-column align="center" prop="methodName" label="请求方式"/>
      <el-table-column align="center" prop="params" label="请求参数"/>
      <el-table-column align="center" prop="exeuTime" width="80" label="执行时间(ms)"/>
      <el-table-column align="center" prop="createTime" label="操作时间"/>
    </el-table>
    <el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="page"
      :page-sizes="[10, 20, 50]"
      :page-size="limit"
      :total="totalCount"
      layout="total, sizes, prev, pager, next, jumper">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    name: 'sys-Journal',
    data () {
      return {
        dataList: [],
        page: 1,
        limit: 10,
        totalCount: 0
      }
    },
    mounted () {
      this.getDataList()
    },
    methods: {
      getDataList () {
        this.$http({
          url: this.$http.adornUrl('/sys/log/list'),
          method: 'post',
          data: {
            page: this.page,
            limit: this.limit
          }
        }).then(data => {
          this.dataList = data.data.list
          this.totalCount = data.data.totalCount
        })
      },
      sizeChangeHandle (val) {
        this.limit = val
        this.getDataList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.page = val
        this.getDataList()
      }
    }
  }
</script>

<style scoped>

</style>
